﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Itop.YHPC.Model;
using Itop.YHPC.controller;

namespace Itop.YHPC.admin {
    public partial class sysgroupAjax :AjaxPage<sysgroup> {
        protected override IList<sysgroup> onRead() {
            return sysgroupController.GetList(null);
        }
        protected override bool onCreate(IList<sysgroup> list) {
            foreach (sysgroup obj in list) {
                obj.id = obj.CreateID();
                sysgroupController.Insert(obj);
            }
            return true;
        }
        protected override bool onUpdate(IList<sysgroup> list) {
            foreach (sysgroup obj in list) {

                sysgroupController.Update(obj);
            }
            return true;
        }

        protected override bool onDelete(IList<sysgroup> list) {
            foreach (sysgroup obj in list) {
                sysgroupController.Delete(obj.id);
            }
            return true;
        }
    }
}
